package com.matt.foundation.vo.course;

import com.matt.foundation.utils.DateUtil;
import lombok.Data;

import java.util.Date;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/9/12
 * *******************************
 */
@Data
public class CourseEvaluateListVo {
    private String childrenCourseItemId;

    private String childrenId;

    private String childrenCourseId;

    private String courseTitle;

    private Integer courseWeek;

    private String beginTime;

    private String endTime;

    private String courseDate;

    private String childrenName;

    private String childrenHeadImgUrl;

    private Integer evaluateStatus;


    public static CourseEvaluateListVo of(Object[] objects) {
        CourseEvaluateListVo vo = new CourseEvaluateListVo();
        vo.setChildrenCourseItemId(objects[0] == null ? "" : objects[0].toString());
        vo.setCourseTitle(objects[1] == null ? "" : objects[1].toString());

        vo.setCourseWeek(objects[2] == null ? 0 : Integer.valueOf(objects[2].toString()));
        vo.setBeginTime(objects[3] == null ? "" : DateUtil.millisToDateTime( ((Date) objects[3]).getTime(), "HH:mm"));
        vo.setEndTime(objects[4] == null ? "" : DateUtil.millisToDateTime( ((Date) objects[4]).getTime(), "HH:mm"));
        vo.setCourseDate(objects[5] == null ? "" : DateUtil.millisToDateTime( ((Date) objects[5]).getTime(), "yyyy-MM-dd"));
        vo.setChildrenName(objects[6] == null ? "" :  objects[6].toString());
        vo.setChildrenHeadImgUrl(objects[7] == null ? "" :  objects[7].toString());
        vo.setChildrenId(objects[8] == null ? "" :  objects[8].toString());
        vo.setChildrenCourseId(objects[9] == null ? "" :  objects[9].toString());
        vo.setEvaluateStatus(0);
        return vo;
    }
}
